<!--冲突申诉详情-->
<div class="dialog_content">
	<form id="info_form" action="{:U('admin/salesDispute/setDisputeStatus')}" method="post">
	<input type="hidden" name="id" value="{$v.id}" />
	<input type="hidden" name="historyStatus" value="{$v.status}" />
	
	<table width="100%" class="table_form">
		<tr>
			<th>IMEI :</th>
			<td>{$v.imei}</td>
		</tr>
		<tr>
			<th>机型 :</th>
			<td>{$v.model}</td>
		</tr>
		<tr>
			<th>录入时间 :</th>
			<td>{:date('Y-m-d H:i:s', $v['salesCreateTime'])}</td>
		</tr>
		<tr>
			<th>录入人 :</th>
			<td>{$v.toRealName}（{$v.toUserStoreName}）</td>
		</tr>
		<tr>
			<th>申诉时间 :</th>
			<td>{:date('Y-m-d H:i:s', $v['disputeCreateTime'])}</td>
		</tr>
		<tr>
			<th>发起人 :</th>
			<td>{$v.createRealName}（{$v.createUserStoreName}）</td>
		</tr>
		<tr>
			<th>处理进度 :</th>
			<td>{$v.progress}</td>
		</tr>
		<if condition="$v['history']['content']">
			<tr>
				<th>理由 :</th>
				<td>{$v.history.content}</td>
			</tr>
		</if>
		<if condition="in_array($v['status'], array(4,5,6,7))">
			<tr>
				<th>录入最终归属 :</th>
				<td>{$v.owner}</td>
			</tr>
		</if>

		<!--
			0 => '待原录入者确认',
			1 => '原始录入者已知晓，待处理',
			2 => '原始录入者认为申诉无效，待申诉者确认',
			3 => '待市场总监处理',
			4 => '市场总监设为无效',
			5 => '市场总监已解决',
			6 => '原始录入者已解决',
			7 => '申诉者同意撤销冲突',
		-->
		
		<if condition="($v['toUserId'] eq $user['id']) AND ($v['status'] eq 1)">
			<tr>
				<th>处理 :</th>
				<td>
					<select name="newStatus">
						<option value="">请选择</option>
						<option value="6">解决冲突，IMEI 归还申诉发起者{$v.createRealName}</option>
						<option value="2">冲突无效，此 IMEI 为我所有</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>处理说明 :</th>
				<td>
				   <textarea id="J_remark" name="content"></textarea>
				</td>
			</tr>
		</if>
		
		<if condition="($v['createUserId'] eq $user['id']) AND ($v['status'] eq 2)">
			<tr>
				<th>处理 :</th>
				<td>
					<select name="newStatus">
						<option value="">请选择</option>
						<option value="3">不同意，交由市场总监处理</option>
						<option value="7">同意，此单结单</option>
					</select>
				</td>
			</tr>
		</if>
		
		<if condition="$v['status'] eq 3 AND ( ($v['createUserCityId'] eq $user['cityId'][0]) OR ($v['toUserCityId'] eq $user['cityId'][0]))">
			<tr>
				<th>处理 :</th>
				<td>
					<select name="newStatus">
						<option value="">请选择</option>
						<option value="4">申诉无效，则 IMEI 仍为“{$v.toRealName}”所有</option>
						<option value="5">申诉有效，则 IMEI 转为“{$v.createRealName}”所有</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>处理说明 :</th>
				<td>
				   <textarea id="J_remark" name="content"></textarea>
				</td>
			</tr>
		</if>
		
	</table>
	</form>
</div>

<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
		} else {
			$.pinphp.tip({content:result.msg, icon:'alert'});
		}
	}
}); 

</script>
